﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace QuizzAdmin
{
    public partial class VragenFilterForm : Form
    {
        public string FilterText = "";

        public VragenFilterForm()
        {
            InitializeComponent();
        }

        private void VragenFilterForm_Load(object sender, EventArgs e)
        {
            txtFilter.Text = FilterText;

            CheckFilterText();
        }

        private void btnGebruik_Click(object sender, EventArgs e)
        {
            FilterText = txtFilter.Text;

        }
        private void btnVerwijder_Click(object sender, EventArgs e)
        {
            FilterText = "";
        }

        private void txtFilter_TextChanged(object sender, EventArgs e)
        {
            CheckFilterText();
        }

        private void CheckFilterText()
        {
            if (!FilterText.Equals(""))
            {
                btnVerwijder.Enabled = true;
            }

            if (txtFilter.Text.Trim() == "")
            {
                btnGebruik.Enabled = false;
            }
            else
            {
                btnGebruik.Enabled = true;
            }
        }
    }
}
